package ssn.repairsystem.service.impl;

import java.io.File;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import ssn.common.util.ExcelUploadUtil;
import ssn.repairsystem.service.RepairSystemService;
import ssn.repairsystem.vo.RepairSystemVO;
import egovframework.rte.fdl.cmmn.AbstractServiceImpl;
import egovframework.rte.fdl.property.EgovPropertyService;

/**  
 * @Class Name : 
 * @Description : 
 * 
 * @author ksh
 * @since 2013. 09.26
 * @version 1.0
 * @see
 */
@SuppressWarnings({"rawtypes","unchecked"})
@Service("repairSystemService")
public class RepairSystemServiceImpl extends AbstractServiceImpl implements RepairSystemService {
	
	@Resource(name="repairSystemDAO")
	private RepairSystemDAO repairSystemDAO; 
	
	@Resource(name = "propertiesService")
    protected EgovPropertyService propertiesService;
	
	/**
	 * 고장/조치현황 정보 입력
	 */
	public void insertRepairSystemInfo(RepairSystemVO vo) throws Exception{
		vo.setSrs_repr_key(repairSystemDAO.selectRepairSystemInfoPk(vo.getSrs_area_key()));
		repairSystemDAO.insertRepairSystemInfo(vo);
	}
	
	
	/**
	 * 고장/조치현황 정보 수정
	 */
	public void updateRepairSystemInfo(RepairSystemVO vo) throws Exception{
		repairSystemDAO.updateRepairSystemInfo(vo);
	}
	
	/**
	 * 고장/조치현황 정보 삭제(DB 삭제) 
	 */
	public void deleteRepairSystemInfo(RepairSystemVO vo) throws Exception{
		repairSystemDAO.deleteRepairSystemInfo(vo);
	}
	
	/**
	 * 고장/조치현황 정보 리스트 및 전체 카운트
	 */
	public Map selectRepairSystemList(RepairSystemVO vo) throws Exception{
		Map resultMap = new HashMap();
		resultMap.put("resultList", repairSystemDAO.selectRepairSystemList(vo));
		resultMap.put("resultListCnt", repairSystemDAO.selectRepairSystemListCnt(vo));
		return resultMap;
	}
	/**
	 * 고장/조치현황 정보 조회
	 */
	public RepairSystemVO selectRepairSystemInfo(RepairSystemVO vo) throws Exception{
		return repairSystemDAO.selectRepairSystemInfo(vo);
	}
}
